<?php
/**
 * Hols class Cache_Stats
 *
 * @author daantimmer
 *
 * @package Library
 * @subpackage Cache
 */

/**
 * Place holder for cache-statistics
 *
 * @author daantimmer
 */
class Cache_Stats{
	public $key = "";
	public $size = 0;
	public $timeout = 0;
	public $timedout = true;
	public $exists = true;
	public $modifiedtime = 0;
	public $lifetime = 0;
	public $expires = 0;
	
	public function __construct($file,$key,$timeout,$timedout){
		$this->key = $key;
		$this->timeout = date("Y-m-d H:i:s",$timeout);
		$this->timedout = $timedout;
		
		$this->exists = file_exists($file);
		
		if($this->exists){
			$this->size = filesize($file);
			$this->modifiedtime = date("Y-m-d H:i:s",filemtime($file));
			
			$this->lifetime = $timeout - filemtime($file);
			
			$this->expires = $timeout - time();
			
			
		}
	}
}